<?php
/**
 * Shopping Cart Class
 * @author Andy
 *
 */
class Cart{
	protected $_Count;
	/**
	 * Get count of items in Shopping Cart
	 */
	public static function getCount(){
		$objCart = new Cart;
		$objCart->_Count = 0;
		if(session_encode()){
	   		$arrSession = explode(";",session_encode());
		}

		for ($iRow = 0; $iRow < count($arrSession); $iRow++) 
		{ 
			if (substr($arrSession[$iRow],0,7) == "sesItem")
			{
				$objCart->_Count ++;
			}
		}	
		return $objCart->_Count;
	}
}